<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@taglib uri="http://displaytag.sf.net" prefix="display" %>
<logic:notPresent name="usuarioVO">
	<a href="<%=request.getContextPath()%>/inicio.do">Inicio</a> --> 
	<a href="<%=request.getContextPath()%>/crearU.do">Registro</a>
</logic:notPresent>
<logic:present name="usuarioVO">
	<logic:notEmpty name="usuarioVO">
	<logic:equal name="usuarioVO" property="usrTipo" value="administrador">
			<a href="<%=request.getContextPath()%>/inicio.do">Inicio</a> --> 
			<a href="<%=request.getContextPath()%>/usuarios.do">Usuarios</a> --> 
			<a href="<%=request.getContextPath()%>/crearU.do">Alta de Usuarios</a>
	</logic:equal>
	</logic:notEmpty>
</logic:present>
<br><br>
<div id="accordion">
	<!-- FORMULARIO REGISTRO -->
	<div><a href="#">Datos Personales</a></div>
	<div align="justify">
		<html:form action="usuario.do"  method="post" styleClass="hform" styleId="formRegistro">
			<ul>
				<li>
				Ingresa la siguiente informaci&oacute;n para crear un nuevo usuario.
				</li>
				<li>
					<label>Usuario:</label>
					<html:text styleId="usrNick"  styleClass="ui-widget-header" property="usrNick"/>
					<script type="text/javascript">
	 					var f1 = new LiveValidation('usrNick', { validMessage: " ", wait: 5 });
	  					f1.add(Validate.Presence, { failureMessage: "Campo obligatorio." } );
	  					f1.add( Validate.Length, {minimum: 3, maximum:10 } );
	  					f1.add( Validate.Exclusion, { within: [ ' ' ], partialMatch: true } );
					</script>
				</li> 
							
				<li>
					<label>Contrase&ntilde;a:</label> 
					<html:password styleId="usrPassword" styleClass="ui-widget-header" property="usrPassword"/>
					<script type="text/javascript">
	 					var f1 = new LiveValidation('usrPassword', { validMessage: " ", wait: 5 });
	  					f1.add(Validate.Presence, { failureMessage: "Campo obligatorio." } );
	  					f1.add( Validate.Length, {minimum: 3, maximum:30 } );
					</script>
				</li>
							
				<li>
					<label>Confirmaci&oacute;n:</label> 
					<html:password styleId="usrPasswordConfirma" styleClass="ui-widget-header" property="usrPasswordConfirma"/>
					<script type="text/javascript">
	 					var f1 = new LiveValidation('usrPasswordConfirma', { validMessage: " ", wait: 5 });
	  					f1.add(Validate.Presence,{ failureMessage: "Campo obligatorio." } );
						f1.add(Validate.Confirmation,{match : 'usrPassword'});
					</script>
				</li>				
				<logic:present name="menu">
					<logic:notEmpty name="menu">
						<li>
							<label>Tipo:</label>
								<html:select styleId="usrTipo" styleClass="ui-widget-header" property="usrTipo">
									<html:option value="Selecciona...">Selecciona...</html:option>
			        				<html:option value="administrador">Administrador</html:option>
			        				<html:option value="supervisor">Supervisor</html:option>
									<html:option value="usuario">Usuario</html:option>
								</html:select>
						
						<script type="text/javascript">
							var f1 = new LiveValidation('usrTipo', { validMessage: " ", wait: 5 });
							f1.add(Validate.Exclusion, { within: ['Selecciona...'], failureMessage: "Selecciona una opcion"});
						</script>
						</li>
					</logic:notEmpty>
				</logic:present>
				<logic:notPresent name="usuarioVO">
					<html:hidden styleId="usrTipo" property="usrTipo" value="usuario"/>
				</logic:notPresent>
			</ul>
			<br>
			<div id="izq">
				<button name="accion" value="altaUsuario" class="ui-state-active ui-corner-all">
					<span style="vertical-align:middle;"><img src="images/guardar.png" height="24" ></span>
					<span style="vertical-align:middle; padding: 0 0 13px;">&nbsp;Guardar&nbsp;</span>					
				</button>
				&nbsp;&nbsp;
				<button id="limpiar" type="reset" class="ui-state-active ui-corner-all" onclick="formReset()">
					<span style="vertical-align:middle;"><img src="images/limpiar.png" height="24"></span>
					<span style="vertical-align:middle; padding: 0 0 13px;">&nbsp;Limpiar&nbsp;</span>								
				</button>
			</div>
		</html:form>
	</div>				
</div>

